package org.kermeta.spem.activityautomation.eclipse.installwtp;

import org.kermeta.spem.activityautomation.eclipse.runcommand.RunCommand;
import org.kermeta.spem.activityautomationmanager.ActivityAutomation;
import org.kermeta.spem.executioncontext.ExecutionContext;
import org.kermeta.spem.processexecution.utils.model.ModelUtils;
import org.kermeta.spem.processexecution.utils.string.StringUtils;

public class InstallWTP implements ActivityAutomation {

	public InstallWTP() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void run(String contextModelPath) {
		ExecutionContext executionContext = 
				ModelUtils.getExecutionContextRoot(
						contextModelPath);
		String localPathOfTheCurrentEclipseApplication = 
				ModelUtils.getValueOfKey(
						"local path of the current Eclipse application", 
						executionContext);
		String localPathOfTheCurrentEclipseApplicationAfterConversion = 
				StringUtils.convertPathIntoString(
						localPathOfTheCurrentEclipseApplication);
		String cmd = 
				localPathOfTheCurrentEclipseApplicationAfterConversion+
				" -application org.eclipse.equinox.p2.director"+
				" -repository http://download.eclipse.org/webtools/repository/indigo/," +
				"http://download.eclipse.org/datatools/updates," +
				"http://download.eclipse.org/graphiti/updates/0.9.2 " +
				"-installIU org.eclipse.graphiti.feature.feature.group/0.9.2.v20130211-0913,org.eclipse.datatools.enablement.feature.feature.group/1.7.0.v200906050400-7J8i0BWwPJNaz-Fe15qs9q203H-b,org.eclipse.jst.ws.axis2tools.feature.feature.group/1.1.200.v201103022333-78-FF0DZRDKDDePSKwHj,org.eclipse.jst.ws.cxf.feature.feature.group/1.0.100.v201105171845-7H77DRFAKlZgjHCaHg65uE6I6I,org.eclipse.jpt.common.feature.feature.group/1.0.2.v201111103010-6-3AkF7BC9EBID797,org.eclipse.jpt.common.eclipselink.feature.feature.group/1.0.1.v201108080010-3-08s73553F3G3343,org.eclipse.jpt.dbws.eclipselink.feature.feature.group/1.0.2.v201202073020-797B5CcNBHGEQHTAwHJBF5,org.eclipse.jpt.jaxb.eclipselink.feature.feature.group/1.0.2.v201202073020-7741BgJ9EEAREX8z0A9572,org.eclipse.jpt.jpa.eclipselink.feature.feature.group/3.0.2.v201202073020-7J7F7EF7RZHQQNYTz-KbSRNVB,org.eclipse.jpt.jaxb.feature.feature.group/1.0.2.v201111103010-508cAkF7BC8GBGA78A,org.eclipse.jpt.jpadiagrameditor.feature.feature.group/1.0.1.v201108100925-4-19oB5885P7C687B,org.eclipse.jpt.jpa.feature.feature.group/3.0.2.v201110193010-7S7B7HFC7sRdlV6fmbQaRBF5,org.eclipse.wst.common.fproj.feature.group/3.3.2.v201201121600-377DH8s735735535DD9,org.eclipse.jst.common.fproj.enablement.jdt.feature.group/3.3.0.v201102200555-377DF8s73543E5I5768,org.eclipse.jst.enterprise_ui.feature.feature.group/3.3.2.v201111030500-7b7II1YFSK2WIuPRDEnExPV-RvTn,org.eclipse.jst.web_ui.feature.feature.group/3.3.2.v201112072049-7F7AFO7C25ToiIbpoiuW12GT78Mciy6W7iwuxaco,org.eclipse.wst.web_ui.feature.feature.group/3.3.2.v201111030500-7O7IFj6EMjB7yO1Xs_G1kMtQeOye6HTXFWve95_R,org.eclipse.wst.xml_ui.feature.feature.group/3.3.2.v201112072049-7H7EFZ7DxumTmce4khcSkIiqoD8eDMKlT8Oz011P,org.eclipse.wst.xsl.feature.feature.group/1.3.1.v201109012200-7T7YFRTFIqUoIrvbEtBlSIJXGZNg,org.eclipse.wst.jsdt.feature.feature.group/1.3.2.v201201112313-7G78FZvFC7sRekSz-g-nAlz,org.eclipse.jsf.feature.feature.group/3.3.1.v201109030441-7E7IDUF9JgLWUM6WBSgXp,org.eclipse.jst.ws.jaxws.dom.feature.feature.group/1.0.101.v201201031445-5-BiAkF7BD7E8NBSHa,org.eclipse.jst.ws.jaxws.feature.feature.group/1.1.0.v201105171845-7E78BsF8NcJSWKvN1Rjcv,org.eclipse.jst.server_adapters.feature.feature.group/3.2.100.v20110303-208Z7w31211419,org.eclipse.jst.server_adapters.ext.feature.feature.group/3.3.2.v20111010_1242-777HFHzCcNBDjCbIUfEEE3,org.eclipse.jst.server_ui.feature.feature.group/3.3.0.v201102200555-7A6FHr9xFcAVCFLZBBJLIR43A,org.eclipse.wst.server_adapters.feature.feature.group/3.2.100.v20110303-51EoAkF77g8HBSc,org.eclipse.jst.jsf.apache.trinidad.tagsupport.feature.feature.group/2.2.200.v201105111126-20A77w312215172822,org.eclipse.jst.webpageeditor.feature.feature.group/2.3.6.v201201181342-46AB9oB5885D6R5D86";
		RunCommand.runCommand(cmd);
	}

}
